#ifndef SDATA_H_
#define SDATA_H_
/*********************************************************/
class sMsg;

#include "sMsg.h"
#include <Poco/DOM/NodeIterator.h>
#include <string>
/*********************************************************/
class sData : public sMsg
{
private:
	// Friend classes
	friend class sMsg;

	// Variables
	bool		shell;				// Is the data shell output or a file?
	std::string	data;				// Data carried by this job
	std::string	fileName;			// The filename
	unsigned long 	size;				// size of the file
	unsigned long 	fSize;				// total file size
	unsigned int	order;				// The byte offset of the data we are transferring

	// Methods
	void deserialize(Poco::XML::NodeIterator&);	// Deserializes an execute job

protected:
public:
	// Control Methods
	virtual std::string serialize() const;		// Serialize the job to an xml string
	virtual void execute();				// Execute the job

	// Information retrieval methods
	std::string getData() const;			// Returns the data string
	unsigned int getOrder() const;			// Returns the order of the data
	bool getShell() const;				// Returns if the data is shell output or file data
	void setData(const std::string&);		// Set the data carried by the job
	void setOrder(const unsigned int&);		// Set the byte position for the data
	void setShell(const bool&);			// Sets the shell parameter
	void setFileName(const std::string&);		// Sets the file name
	std::string getFileName() const;		// Returns the file name
	unsigned long getFileSize() const;		// Returns the total file size
	void setFileSize(const unsigned long&);		// Sets the total file size

	// Construction & Destruction
	sData() {};
	~sData() {};
};
/*********************************************************/
#endif // SDATA_H_
